This was made to test mstar and cstar only simulations.
In [12]:
cd ~/research/TP-AGBcalib/code/TPAGB-calib/
In [13]:
from IPython import parallel
import sfh_tests_multi_proc
import itertools
from TPAGBparams import snap_src
In [14]:
# must first make the galaxy inputs by hand. To do only mstar or cstar, also need to check tab_mag_ tables.
In [15]:
%pylab tk
In [16]:
def caller(vSFH, vsfh_kws):
return vSFH.vary_the_SFH(**vsfh_kws)
In [17]:
clients = parallel.Client()
clients.block = False
In [18]:
clients[:].execute('cd ~/research/TP-AGBcalib/code/TPAGB-calib/')
clients[:].execute('import sfh_tests_multi_proc')
Out[18]:
In [34]:
reload(sfh_tests_multi_proc)
clients[:].execute('reload(sfh_tests_multi_proc)')
Out[34]:
In [20]:
targets = ['scl-de1','ngc2976-deep']
cmd_inputs = ['cmd_input_CAF09_S_NOV13.dat', 'cmd_input_CAF09_S_NOV13eta0.dat', 'cmd_input_CAF09_S_OCT13.dat']
nsfhs = 15
In [37]:
#extra_str = '_cstar'
extra_str = '_mstar'
In [38]:
# use a different galaxy input file and name the LF and narratio files differently
default_kw = {'galaxy_input_src': snap_src + '/input/tests/',
'galaxy_input_search_fmt': '*%s' + '%s.dat' % extra_str}
vsfh_kw = {'extra_str' : extra_str}
In [39]:
vSFHs, vsfh_kws = sfh_tests_multi_proc.prepare_vsfh_run(targets, cmd_inputs, nsfhs, default_kw=default_kw, vsfh_kw=vsfh_kw)
In [40]:
res = [clients[i].apply(caller, vSFHs[i], vsfh_kws,) for i in range(len(vSFHs))]
In [49]:
[r.ready() for r in res]
Out[49]:
In [32]:
#pdb
In [50]:
[vSFHs[i].write_results(res[i].result) for i in range(len(vSFHs))]
Out[50]:
In [ ]:
In [ ]: